#ifndef __Math__Play__
#define __Math__Play__

#include "cocos2d.h"
#include "ui/CocosGUI.h"
#include "PLayConfig.h"
#include "../Level/LevelConfig.h"
#include "../../GamePlayConfig.h"
USING_NS_CC;
using namespace ui;
class PlayManager : public cocos2d::Layer
{
private:
    Size m_screenSize;
    void initBackground();
    void initLayer();
    void initGhost();
    void initGame();
    void initResult();
    void initCongratulations();
    void calculateTimePlay(Ref* pSender);
    void OpenCongratulationsLayer();
    void OpenResultLayer();
    void OpenPlaySelectLayer();
	void OpenPlayAdjustLayer();
    void ReturnLevelScene();
    void AdjustGhost(Ref* pSender);
    
    ELevelMode m_ELevelMode;
	EModeType m_EModeType;
	
    Sprite* m_Clound;
	LoadingBar* m_loadingBar;
    Node* m_PlaySelectLayer;
	Node* m_PlayAdjustLayer;
    Node* m_CongratulationsLayer;
    Node* m_ResultLayer;
    Node* m_nodeGhostPlay;
    int m_NumberResult;
    int m_currStar;
    
    int* m_arrGhost;
    float kSpriteWidth;
    float kSpriteHeight;
    float kPaddingWidth;
    float kPaddingHeight;
public:
    static Scene* createScene();
    void update(float dt);
    void initialize();
    static EGameStatus m_EGameStatus; // 0 - normal   1 - win   2 - lose
    
    float kScale;
    virtual bool init();
    CREATE_FUNC(PlayManager);
};


#endif // __HELLOWORLD_SCENE_H__
